{include file="./header" title="在线升级" /}
<script src="https://code.jquery.com/jquery-3.1.1.min.js"></script>

<div class="jumbotron">
    <p class="lead">{:lang('升级过程中请勿关闭该网页')}</p>
    <div class="file_list">
    	
    </div>
</div>

<script>
$(function(){
	download();
});


function download(){
	
	$.getJSON('./update.php?action=file',function(data){
		//alert(data.dir);
		console.log(data);
		if(data.size > 0){
			$('.file_list').prepend('<p>'+data.dir+'</p>');
			setTimeout(download,500);
			//setTimeout(download(),10000);
		}else{
			$('.file_list').prepend('<p>文件更新完成,准备更新数据库</p>');
			window.location.href="{:url('sql')}";	
		}
		//return data.dir;
	});
	
}

</script>

{include file="./footer" /}